﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.ComponentModel.DataAnnotations;

namespace BadmintonBuddy.Models
{
    [Bind(Exclude="ClubID")]
    public class Club_Validation
    {
        [Required(ErrorMessage = "Please enter Club Name.")]
        public string ClubName { get; set; }

        [Required(ErrorMessage = "Please enter Address for the Club")]
        public string Address { get; set; }

        [Required(ErrorMessage = "Please enter City Name.")]
        public string City { get; set; }

        [Email(ErrorMessage="Not a valid email")]
        public string Email { get; set; }


    }

    public class EmailAttribute: RegularExpressionAttribute
    {
        public EmailAttribute():base("^[a-z0-9_\\+-]+(\\.[a-z0-9_\\+-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*\\.([a-z]{2,4})$"){}
        
    }
}
